package com.example.demo.util;

/**
 * @Author: kangyang
 * @Description: 创建业务系统参数
 * @DateTime: 2024/11/26 10:22
 **/
public class SystemParamUtils {


    public static void main(String[] args) {
        String format = getFromat();
        // param_code, param_name, param_remark, param_type, param_value
        String paramCode = "DELIVERY_UNTIL_LIST_DATE";
        String paramName = "预计到仓日期与上市日期的间隔天数";
        String paramRemark = "该参数填写整数，用于发货订单计算原始预计到仓日期";
        String paramType = "number";
        String paramValue = "8";
        String systemParam = String.format(format, paramCode.toLowerCase(), paramName, paramRemark, paramType, paramValue);
        System.out.println(systemParam);
    }

    private static String getFromat() {
        String fromat = "INSERT INTO r3_base.cp_c_business_system_parameters (id, param_code, param_name, param_remark, param_type, param_value, ad_org_id, isactive, ad_client_id, ownerid, ownerename, ownername, creationdate, modifierid, modifierename, modifiername, modifieddate) VALUES((select IFNULL(MAX(id), 0) + 1 from `r3_base`.`cp_c_business_system_parameters`),'%s','%s','%s','%s',%s,27,'Y',37,893,'系统管理员','系统管理员',current_time(),893,'系统管理员','系统管理员',current_time());";
        return fromat;
    }


}
